/*
 * 
 * 
 */

package DigimonAdventure;

import DigimonAdventure.Things.Player;
//der, gw masuk2in dlu d smua user interfacenya
import DigimonAdventure.Things.Shop;
import DigimonAdventure.UserInterface.MenuUtama;
import DigimonAdventure.UserInterface.City;
import DigimonAdventure.UserInterface.WorldMap;
import DigimonAdventure.UserInterface.InventoryDialog;
import DigimonAdventure.UserInterface.StageFinal;
import DigimonAdventure.UserInterface.StageKedua;
import DigimonAdventure.UserInterface.StagePertama;
import DigimonAdventure.UserInterface.StatusDialog;
import DigimonAdventure.UserInterface.Event;
import DigimonAdventure.UserInterface.EventS;
import DigimonAdventure.World.FinalStage;
import DigimonAdventure.World.SafeHouse;
import DigimonAdventure.World.Stage1;
import DigimonAdventure.World.Stage2;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Timer;


/**
 *
 * @author Kris Derril Siregar
 */
public class DigimonAdventure {
    //Atribut-atribut model
    public static Player pemain;
    public static Shop toko;
    public static SafeHouse kota;
    public static Stage1 stage1;
    public static Stage2 stage2;
    public static FinalStage stage3;

    //Atribut-atribut user interface /viewer
    public static WorldMap petadunia;
    public static MenuUtama menuutama;
    public static City kotaui;
    public static StagePertama stage1ui;
    public static StageKedua stage2ui;
    public static StageFinal stage3ui;
    public static InventoryDialog inventoriui;
    public static StatusDialog statusui;
    public static Event eventui;
    public static EventS event2ui;

    private static void initGame(){
        //isinya menginisialiasi modeler
        pemain = new Player();
        kota = new SafeHouse();
        stage1 = new Stage1();
        stage2 = new Stage2();
        stage3 = new FinalStage();
        toko = new Shop();
        petadunia = new WorldMap();
        menuutama = new MenuUtama();
        kotaui = new City();
        stage1ui = new StagePertama();
        stage2ui = new StageKedua();
        stage3ui = new StageFinal();
        inventoriui = new InventoryDialog(null ,false);
        statusui = new StatusDialog(null,false);
        eventui = new Event();
        event2ui = new EventS();
    }
    public static void doLoadGame(){}
    public static void doNewGame(){
    
    }
    
    public static void runGlobalTimer(){
       Action actionlisten = new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
              
            }
        };
        Timer a = new Timer(1000,actionlisten);
        a.start();

        
    }
        
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        try{
            javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
        }catch(Exception e){
            
        }
        
        initGame();
         //menginisialisasi monster
        stage1ui.setDigimonLiar(stage1.getCompleteThings());
        stage2ui.setDigimonLiar(stage2.getCompleteThings());
        stage3ui.setDigimonLiar(stage3.getCompleteThings());
        try{
        java.awt.EventQueue.invokeLater( new Runnable() { //Sebaiknya hanya menginisialisasi GUI saja
              public void run () throws NullPointerException  {
                    menuutama.setVisible(true); //mulailah dari menu utama
                }


        });
        }catch(NullPointerException e){

        }
       

   }

}
